.TH "QwtPlotItem" 3 "Tue Nov 20 2012" "Version 5.2.3" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotItem \- 
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_item\&.h>\fP
.PP
Inherits \fBQwtLegendItemManager\fP\&.
.PP
Inherited by \fBQwtPlotCurve\fP, \fBQwtPlotGrid\fP, \fBQwtPlotMarker\fP, \fBQwtPlotRasterItem\fP, \fBQwtPlotScaleItem\fP, and \fBQwtPlotSvgItem\fP\&.
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBItemAttribute\fP { \fBLegend\fP =  1, \fBAutoScale\fP =  2 }"
.br
.ti -1c
.RI "enum \fBRenderHint\fP { \fBRenderAntialiased\fP =  1 }"
.br
.ti -1c
.RI "enum \fBRttiValues\fP { \fBRtti_PlotItem\fP =  0, \fBRtti_PlotGrid\fP, \fBRtti_PlotScale\fP, \fBRtti_PlotMarker\fP, \fBRtti_PlotCurve\fP, \fBRtti_PlotHistogram\fP, \fBRtti_PlotSpectrogram\fP, \fBRtti_PlotSVG\fP, \fBRtti_PlotUserItem\fP =  1000 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtPlotItem\fP (const \fBQwtText\fP &\fBtitle\fP=\fBQwtText\fP())"
.br
.ti -1c
.RI "virtual \fB~QwtPlotItem\fP ()"
.br
.ti -1c
.RI "void \fBattach\fP (\fBQwtPlot\fP *\fBplot\fP)"
.br
.ti -1c
.RI "virtual QwtDoubleRect \fBboundingRect\fP () const "
.br
.ti -1c
.RI "void \fBdetach\fP ()"
.br
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRect &canvasRect) const =0"
.br
.ti -1c
.RI "void \fBhide\fP ()"
.br
.ti -1c
.RI "QwtDoubleRect \fBinvTransform\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &, const QRect &) const "
.br
.ti -1c
.RI "bool \fBisVisible\fP () const "
.br
.ti -1c
.RI "virtual void \fBitemChanged\fP ()"
.br
.ti -1c
.RI "virtual QWidget * \fBlegendItem\fP () const "
.br
.ti -1c
.RI "QRect \fBpaintRect\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &) const "
.br
.ti -1c
.RI "\fBQwtPlot\fP * \fBplot\fP () const "
.br
.ti -1c
.RI "virtual int \fBrtti\fP () const "
.br
.ti -1c
.RI "QwtDoubleRect \fBscaleRect\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &) const "
.br
.ti -1c
.RI "void \fBsetAxis\fP (int \fBxAxis\fP, int \fByAxis\fP)"
.br
.ti -1c
.RI "void \fBsetItemAttribute\fP (\fBItemAttribute\fP, bool on=true)"
.br
.ti -1c
.RI "void \fBsetRenderHint\fP (\fBRenderHint\fP, bool on=true)"
.br
.ti -1c
.RI "void \fBsetTitle\fP (const QString &\fBtitle\fP)"
.br
.ti -1c
.RI "void \fBsetTitle\fP (const \fBQwtText\fP &\fBtitle\fP)"
.br
.ti -1c
.RI "virtual void \fBsetVisible\fP (bool)"
.br
.ti -1c
.RI "void \fBsetXAxis\fP (int axis)"
.br
.ti -1c
.RI "void \fBsetYAxis\fP (int axis)"
.br
.ti -1c
.RI "void \fBsetZ\fP (double \fBz\fP)"
.br
.ti -1c
.RI "void \fBshow\fP ()"
.br
.ti -1c
.RI "bool \fBtestItemAttribute\fP (\fBItemAttribute\fP) const "
.br
.ti -1c
.RI "bool \fBtestRenderHint\fP (\fBRenderHint\fP) const "
.br
.ti -1c
.RI "const \fBQwtText\fP & \fBtitle\fP () const "
.br
.ti -1c
.RI "QRect \fBtransform\fP (const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &, const QwtDoubleRect &) const "
.br
.ti -1c
.RI "virtual void \fBupdateLegend\fP (\fBQwtLegend\fP *) const "
.br
.ti -1c
.RI "virtual void \fBupdateScaleDiv\fP (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)"
.br
.ti -1c
.RI "int \fBxAxis\fP () const "
.br
.ti -1c
.RI "int \fByAxis\fP () const "
.br
.ti -1c
.RI "double \fBz\fP () const "
.br
.in -1c
.SH "Detailed Description"
.PP 
Base class for items on the plot canvas\&. 

A plot item is 'something', that can be painted on the plot canvas, or only affects the scales of the plot widget\&. They can be categorized as:
.PP
.IP "\(bu" 2
Representator
.br
 A 'Representator' is an item that represents some sort of data on the plot canvas\&. The different representator classes are organized according to the characteristics of the data:
.IP "  \(bu" 4
\fBQwtPlotMarker\fP Represents a point or a horizontal/vertical coordinate
.IP "  \(bu" 4
\fBQwtPlotCurve\fP Represents a series of points
.IP "  \(bu" 4
\fBQwtPlotSpectrogram\fP ( \fBQwtPlotRasterItem\fP ) Represents raster data
.IP "  \(bu" 4
\&.\&.\&.
.PP

.PP
.PP
.IP "\(bu" 2
Decorators
.br
 A 'Decorator' is an item, that displays additional information, that is not related to any data:
.IP "  \(bu" 4
\fBQwtPlotGrid\fP
.IP "  \(bu" 4
\fBQwtPlotScaleItem\fP
.IP "  \(bu" 4
\fBQwtPlotSvgItem\fP
.IP "  \(bu" 4
\&.\&.\&.
.PP

.PP
.PP
Depending on the \fBQwtPlotItem::ItemAttribute\fP flags, an item is included into autoscaling or has an entry on the legnd\&.
.PP
Before misusing the existing item classes it might be better to implement a new type of plot item ( don't implement a watermark as spectrogram )\&. Deriving a new type of \fBQwtPlotItem\fP primarily means to implement the YourPlotItem::draw() method\&.
.PP
\fBSee also:\fP
.RS 4
The cpuplot example shows the implementation of additional \fBplot\fP items\&. 
.RE
.PP

.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBQwtPlotItem::ItemAttribute\fP"
Plot Item Attributes
.PP
.IP "\(bu" 2
Legend
.br
 The item is represented on the legend\&.
.IP "\(bu" 2
AutoScale 
.br
 The \fBboundingRect()\fP of the item is included in the autoscaling calculation\&.
.PP
.PP
\fBSee also:\fP
.RS 4
\fBsetItemAttribute()\fP, \fBtestItemAttribute()\fP 
.RE
.PP

.SS "enum \fBQwtPlotItem::RttiValues\fP"

.PP
Runtime type information\&. RttiValues is used to cast plot items, without having to enable runtime type information of the compiler\&. 
.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtPlotItem::QwtPlotItem (const \fBQwtText\fP &title = \fC\fBQwtText\fP()\fP)\fC [explicit]\fP"
Constructor 
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title of the item 
.RE
.PP

.SH "Member Function Documentation"
.PP 
.SS "void QwtPlotItem::attach (\fBQwtPlot\fP *plot)"

.PP
Attach the item to a plot\&. This method will attach a \fBQwtPlotItem\fP to the \fBQwtPlot\fP argument\&. It will first detach the \fBQwtPlotItem\fP from any plot from a previous call to attach (if necessary)\&. If a NULL argument is passed, it will detach from any \fBQwtPlot\fP it was attached to\&.
.PP
\fBParameters:\fP
.RS 4
\fIplot\fP Plot widget 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQwtPlotItem::detach()\fP 
.RE
.PP

.SS "QwtDoubleRect QwtPlotItem::boundingRect () const\fC [virtual]\fP"
\fBReturns:\fP
.RS 4
An invalid bounding rect: QwtDoubleRect(1\&.0, 1\&.0, -2\&.0, -2\&.0) 
.RE
.PP

.PP
Reimplemented in \fBQwtPlotCurve\fP, \fBQwtPlotMarker\fP, \fBQwtPlotSpectrogram\fP, and \fBQwtPlotSvgItem\fP\&.
.SS "void QwtPlotItem::detach ()\fC [inline]\fP"

.PP
This method detaches a \fBQwtPlotItem\fP from any \fBQwtPlot\fP it has been associated with\&. \fBdetach()\fP is equivalent to calling attach( NULL ) 
.PP
\fBSee also:\fP
.RS 4
\fBattach( QwtPlot* plot )\fP 
.RE
.PP

.SS "virtual void QwtPlotItem::draw (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRect &canvasRect) const\fC [pure virtual]\fP"

.PP
Draw the item\&. \fBParameters:\fP
.RS 4
\fIpainter\fP Painter 
.br
\fIxMap\fP Maps x-values into pixel coordinates\&. 
.br
\fIyMap\fP Maps y-values into pixel coordinates\&. 
.br
\fIcanvasRect\fP Contents rect of the canvas in painter coordinates 
.RE
.PP

.PP
Implemented in \fBQwtPlotCurve\fP, \fBQwtPlotMarker\fP, \fBQwtPlotScaleItem\fP, \fBQwtPlotSpectrogram\fP, \fBQwtPlotRasterItem\fP, \fBQwtPlotGrid\fP, and \fBQwtPlotSvgItem\fP\&.
.SS "QwtDoubleRect QwtPlotItem::invTransform (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRect &rect) const"
Transform a rectangle from paint to scale coordinates
.PP
\fBParameters:\fP
.RS 4
\fIxMap\fP X map 
.br
\fIyMap\fP Y map 
.br
\fIrect\fP Rectangle in paint coordinates 
.RE
.PP
\fBReturns:\fP
.RS 4
Rectangle in scale coordinates 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtransform()\fP 
.RE
.PP

.SS "bool QwtPlotItem::isVisible () const"
\fBReturns:\fP
.RS 4
true if visible 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetVisible()\fP, \fBshow()\fP, \fBhide()\fP 
.RE
.PP

.SS "void QwtPlotItem::itemChanged ()\fC [virtual]\fP"
Update the legend and call \fBQwtPlot::autoRefresh\fP for the parent plot\&.
.PP
\fBSee also:\fP
.RS 4
\fBupdateLegend()\fP 
.RE
.PP

.SS "QWidget * QwtPlotItem::legendItem () const\fC [virtual]\fP"

.PP
Allocate the widget that represents the item on the legend\&. The default implementation is made for \fBQwtPlotCurve\fP and returns a QwtLegendItem(), but an item could be represented by any type of widget, by overloading \fBlegendItem()\fP and \fBupdateLegend()\fP\&.
.PP
\fBReturns:\fP
.RS 4
QwtLegendItem() 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBupdateLegend()\fP QwtLegend() 
.RE
.PP

.PP
Implements \fBQwtLegendItemManager\fP\&.
.SS "QRect QwtPlotItem::paintRect (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap) const"

.PP
Calculate the bounding paint rect of 2 maps\&. \fBParameters:\fP
.RS 4
\fIxMap\fP X map 
.br
\fIyMap\fP X map
.RE
.PP
\fBReturns:\fP
.RS 4
Bounding rect of the scale maps 
.RE
.PP

.SS "int QwtPlotItem::rtti () const\fC [virtual]\fP"
Return rtti for the specific class represented\&. \fBQwtPlotItem\fP is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them\&.
.PP
The rtti value is useful for environments, where the runtime type information is disabled and it is not possible to do a dynamic_cast<\&.\&.\&.>\&.
.PP
\fBReturns:\fP
.RS 4
rtti value 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBRttiValues\fP 
.RE
.PP

.PP
Reimplemented in \fBQwtPlotCurve\fP, \fBQwtPlotSpectrogram\fP, \fBQwtPlotMarker\fP, \fBQwtPlotScaleItem\fP, \fBQwtPlotSvgItem\fP, and \fBQwtPlotGrid\fP\&.
.SS "QwtDoubleRect QwtPlotItem::scaleRect (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap) const"

.PP
Calculate the bounding scale rect of 2 maps\&. \fBParameters:\fP
.RS 4
\fIxMap\fP X map 
.br
\fIyMap\fP X map
.RE
.PP
\fBReturns:\fP
.RS 4
Bounding rect of the scale maps 
.RE
.PP

.SS "void QwtPlotItem::setAxis (intxAxis, intyAxis)"
Set X and Y axis
.PP
The item will painted according to the coordinates its Axes\&.
.PP
\fBParameters:\fP
.RS 4
\fIxAxis\fP X Axis 
.br
\fIyAxis\fP Y Axis
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetXAxis()\fP, \fBsetYAxis()\fP, \fBxAxis()\fP, \fByAxis()\fP 
.RE
.PP

.SS "void QwtPlotItem::setItemAttribute (\fBItemAttribute\fPattribute, boolon = \fCtrue\fP)"
Toggle an item attribute
.PP
\fBParameters:\fP
.RS 4
\fIattribute\fP Attribute type 
.br
\fIon\fP true/false
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtestItemAttribute()\fP, \fBItemAttribute\fP 
.RE
.PP

.SS "void QwtPlotItem::setRenderHint (\fBRenderHint\fPhint, boolon = \fCtrue\fP)"
Toggle an render hint
.PP
\fBParameters:\fP
.RS 4
\fIhint\fP Render hint 
.br
\fIon\fP true/false
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtestRenderHint()\fP, \fBRenderHint\fP 
.RE
.PP

.SS "void QwtPlotItem::setTitle (const QString &title)"
Set a new title
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtitle()\fP 
.RE
.PP

.SS "void QwtPlotItem::setTitle (const \fBQwtText\fP &title)"
Set a new title
.PP
\fBParameters:\fP
.RS 4
\fItitle\fP Title 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtitle()\fP 
.RE
.PP

.SS "void QwtPlotItem::setVisible (boolon)\fC [virtual]\fP"
Show/Hide the item
.PP
\fBParameters:\fP
.RS 4
\fIon\fP Show if true, otherwise hide 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisVisible()\fP, \fBshow()\fP, \fBhide()\fP 
.RE
.PP

.SS "void QwtPlotItem::setXAxis (intaxis)"
Set the X axis
.PP
The item will painted according to the coordinates its Axes\&.
.PP
\fBParameters:\fP
.RS 4
\fIaxis\fP X Axis 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetAxis()\fP, \fBsetYAxis()\fP, \fBxAxis()\fP 
.RE
.PP

.SS "void QwtPlotItem::setYAxis (intaxis)"
Set the Y axis
.PP
The item will painted according to the coordinates its Axes\&.
.PP
\fBParameters:\fP
.RS 4
\fIaxis\fP Y Axis 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetAxis()\fP, \fBsetXAxis()\fP, \fByAxis()\fP 
.RE
.PP

.SS "void QwtPlotItem::setZ (doublez)"

.PP
Set the z value\&. Plot items are painted in increasing z-order\&.
.PP
\fBParameters:\fP
.RS 4
\fIz\fP Z-value 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBz()\fP, \fBQwtPlotDict::itemList()\fP 
.RE
.PP

.SS "bool QwtPlotItem::testItemAttribute (\fBItemAttribute\fPattribute) const"
Test an item attribute
.PP
\fBParameters:\fP
.RS 4
\fIattribute\fP Attribute type 
.RE
.PP
\fBReturns:\fP
.RS 4
true/false 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetItemAttribute()\fP, \fBItemAttribute\fP 
.RE
.PP

.SS "bool QwtPlotItem::testRenderHint (\fBRenderHint\fPhint) const"
Test a render hint
.PP
\fBParameters:\fP
.RS 4
\fIhint\fP Render hint 
.RE
.PP
\fBReturns:\fP
.RS 4
true/false 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetRenderHint()\fP, \fBRenderHint\fP 
.RE
.PP

.SS "const \fBQwtText\fP & QwtPlotItem::title () const"
\fBReturns:\fP
.RS 4
Title of the item 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetTitle()\fP 
.RE
.PP

.SS "QRect QwtPlotItem::transform (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QwtDoubleRect &rect) const"
Transform a rectangle
.PP
\fBParameters:\fP
.RS 4
\fIxMap\fP X map 
.br
\fIyMap\fP Y map 
.br
\fIrect\fP Rectangle in scale coordinates 
.RE
.PP
\fBReturns:\fP
.RS 4
Rectangle in paint coordinates
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinvTransform()\fP 
.RE
.PP

.SS "void QwtPlotItem::updateLegend (\fBQwtLegend\fP *legend) const\fC [virtual]\fP"

.PP
Update the widget that represents the item on the legend\&. \fBupdateLegend()\fP is called from \fBitemChanged()\fP to adopt the widget representing the item on the legend to its new configuration\&.
.PP
The default implementation is made for \fBQwtPlotCurve\fP and updates a QwtLegendItem(), but an item could be represented by any type of widget, by overloading \fBlegendItem()\fP and \fBupdateLegend()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIlegend\fP Legend
.RE
.PP
\fBSee also:\fP
.RS 4
\fBlegendItem()\fP, \fBitemChanged()\fP, QwtLegend() 
.RE
.PP

.PP
Implements \fBQwtLegendItemManager\fP\&.
.PP
Reimplemented in \fBQwtPlotCurve\fP\&.
.SS "void QwtPlotItem::updateScaleDiv (const \fBQwtScaleDiv\fP &, const \fBQwtScaleDiv\fP &)\fC [virtual]\fP"

.PP
Update the item to changes of the axes scale division\&. Update the item, when the axes of plot have changed\&. The default implementation does nothing, but items that depend on the scale division (like QwtPlotGrid()) have to reimplement \fBupdateScaleDiv()\fP
.PP
\fBParameters:\fP
.RS 4
\fIxScaleDiv\fP Scale division of the x-axis 
.br
\fIyScaleDiv\fP Scale division of the y-axis
.RE
.PP
\fBSee also:\fP
.RS 4
\fBQwtPlot::updateAxes()\fP 
.RE
.PP

.PP
Reimplemented in \fBQwtPlotScaleItem\fP, and \fBQwtPlotGrid\fP\&.
.SS "double QwtPlotItem::z () const"
Plot items are painted in increasing z-order\&.
.PP
\fBReturns:\fP
.RS 4
\fBsetZ()\fP, \fBQwtPlotDict::itemList()\fP 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
